<%@page import="util.enviaEmail"%>
<%
Connection conn = null;
try {
	conn = new Conexao().getConexao();
} catch (Exception e) {
	new enviaEmail().enviar(e);
	out.print("falhaConexao");
	return;
}
%>
<%@page import="java.sql.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="conexao.Conexao"%>
<%@page import="java.sql.Connection"%>
<%@page import="dao.clienteDao"%>
<%@page import="bean.clienteBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		clienteBean cli = new clienteBean();
		cli.setId(Integer.parseInt(request.getParameter("id")));
		clienteBean cliente = new clienteDao().getcliente(conn, cli);
		SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
		String data = sdf.format(new Date(cliente.getData().getTime()));
	%>
	<p>
	Data de Cadastro.:
	<%=data%>
	</p>
	<form id="formCadastrarCliente" class="form">
		<table border="0" cellpadding="2" cellspacing="1">
			<tr>
				<td colspan="2">Nome do cliente<br /> <input type="text" disabled="disabled"
					id="cadastroNome" name="cadastroNome"
					class="text ui-widget-content ui-corner-all" size="66"
					value="<%=cliente.getNome()%>"></td>
			</tr>
			<tr>
				<td colspan="2">
					<table>
						<tr>
							<td>CPF<br /> <input type="text" id="cadastroCPF" disabled="disabled"
								name="cadastroCPF" class="text ui-widget-content ui-corner-all"
								size="30" value="<%=cliente.getCpf()%>">
							</td>
							<td>CNPJ<br /> <input type="text" id="cadastroCNPJ" disabled="disabled"
								name="cadastroCNPJ" class="text ui-widget-content ui-corner-all"
								size="30" value="<%=cliente.getCnpj()%>">
							</td>
						</tr>
					</table></td>
			</tr>
			<tr>
				<td colspan="2">
					<table>
						<tr>
							<td>Endereço<br /> <input type="text" id="cadastroEndereco"
								name="cadastroEndereco" disabled="disabled"
								class="text ui-widget-content ui-corner-all" size="55"
								value="<%=cliente.getEndereco()%>"></td>
							<td>Nº<br /> <input type="text" id="cadastroNumero"
								maxlength="5" name="cadastroNumero" disabled="disabled"
								class="text ui-widget-content ui-corner-all" size="5"
								value="<%=cliente.getNumero()%>">
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>Bairro<br /> <input type="text" id="cadastroBairro" disabled="disabled"
					name="cadastroBairro" class="text ui-widget-content ui-corner-all"
					value="<%=cliente.getBairro()%>"></td>
				<td>Cidade<br /> <input type="text" id="cadastroBairro" disabled="disabled"
					name="cadastroBairro" class="text ui-widget-content ui-corner-all"
					value="<%=cliente.getNomeCidade()%>"></td>
			</tr>
			<tr>
				<td>Telefone<br /> <input type="text" id="cadastroTelefone"
					name="cadastroTelefone" disabled="disabled"
					class="text ui-widget-content ui-corner-all"
					value="<%=cliente.getTelefone()%>"></td>
				<td>Celular<br /> <input type="text" id="cadastroCelular" disabled="disabled"
					name="cadastroCelular" class="text ui-widget-content ui-corner-all"
					value="<%=cliente.getCelular()%>"></td>
			</tr>
		</table>
	</form>
</body>
</html>